package com.hcw.bankdemob.config;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;

/**
 * @ClassName MybatisConfig
 * @description: mybaits注解配置文件
 * @author: hcw
 * @time: 2020/8/29 11:09
 */
//@Configuration
@Slf4j
public class MybatisConfig {
    @Bean
    public ConfigurationCustomizer configurationCustomizer() {
        return new ConfigurationCustomizer() {
            @Override
            public void customize(org.apache.ibatis.session.Configuration configuration) {
                configuration.setMapUnderscoreToCamelCase(true);//设置驼峰命名规则
                log.info("加载mybatis配置文件");
                System.out.println("加载mybatis配置文件");
            }
        };
    }
}